package com.base.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;

/**
 * 开发公司：个人
 * 版权：个人
 * <p>
 * IndexController
 *
 * @author 刘志强
 * @created Create Time: 2019/5/23
 */
@Controller
public class IndexController {

    // 重定向至首页
    @GetMapping("/")
    public void root(HttpServletResponse httpServletResponse) throws IOException {
        httpServletResponse.sendRedirect("/index");
    }

    @GetMapping("/index")
    @ResponseBody
    public Map index() {
        Map<String,String> map = new HashMap();
        map.put("作者","刘志强");
        return map;
    }
}